package com.itggm.controller;

import com.itggm.Result.ResponseResult;
import com.itggm.service.MailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: ggm
 * @data 2024年12月20日 16:33
 */
@Slf4j
@RestController
@RequestMapping("/mail")
public class MailController {



    @Autowired
    private MailService mailService;
    /**
     * @Author: ggm
     * @date:  2024/12/20
     * 发送qq验证码
     */
    @GetMapping("sendMessage/{emailAddress}")
    public ResponseResult sendMessage(@PathVariable String emailAddress){
        log.info("开始发送电子邮件到{}",emailAddress);
        mailService.sendMessage(emailAddress);
        return ResponseResult.success();

    }

}
